package com.xjun.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/user")
public class UserController {
    @RequestMapping("/t1")
    public String test1(@RequestParam("username")String name , Model model){
        //1.接收前端数据
        System.out.println("接收到的前端的参数为:"+name);
        //2.将返回的结果传递给前端，Model
        model.addAttribute("msg",name);
        //3.视图跳转
        return "test";
    }
}
